package kr.hkit.powerjava.chapter14;

import java.awt.GridLayout;
import java.awt.HeadlessException;

import javax.swing.JButton;
import javax.swing.JFrame;

class MyFrame02 extends JFrame {

	public MyFrame02() throws HeadlessException {
		super();
		setTitle("GridLayoutTest");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		setLayout(new GridLayout(0, 3));

		add(new JButton("Button1"));
		add(new JButton("Button2"));
		add(new JButton("Button3"));
		add(new JButton("B4"));
		add(new JButton("Long Button5"));

		pack();
		setVisible(true);

	}
}

public class GridTest {
	public static void main(String[] args) {
		MyFrame02 f = new MyFrame02();
	}

}
